package string;

public class StringBuilderDemo {
    /**
     * append()增
     * delete()删
     * insert()插
     * replace()改
     */
    public static void main(String[] args) {
        String str = "我爱Java,我要好好学习.";
        StringBuilder sb = new StringBuilder(str);
        System.out.println(str);
        System.out.println(sb);
        sb.append("学好了,可以找到好工作.");
        System.out.println(sb);
        sb.append("1111");
        System.out.println(sb);
        sb.delete(26,30);
        System.out.println(sb);
        sb.insert(22,11);
        System.out.println(sb);
        sb.replace(17,25,"每天开心");
        System.out.println(sb);

        str=new String(sb);
        str=str.trim();
        System.out.println(str);

    }
}
